<?php

require_once("$CFG->libdir/formslib.php");

class block_guestbook_form extends moodleform {
    
    function definition() {

        $mform  = $this->_form;
        $course = $this->_customdata['course'];
        
        $elementgroup = array();
        $elementgroup[] = $mform->createElement('text', 'name', '', array('size' => '30', 'maxlength' => '255'));
        $mform->setType('name', PARAM_TEXT);

        $mform->addGroup($elementgroup, 'name_group', get_string('name', 'block_guestbook'), ' ', false);
        $mform->addGroupRule('name_group', array('name' => array(array(get_string('maximumchars', '', 255), 'maxlength', 255))));
        
        $mform->addElement('textarea', 'message', get_string('messagesname', 'block_guestbook'), 'wrap="virtual" rows="20", cols="80"');
        $mform->setType('message', PARAM_TEXT);
        
        $this->add_action_buttons(false, 'Send');
    }   
}